<template>
  <div class="hello">
    <!-- <vue-datepicker-local format="YYYY-MM-DD HH:mm:ss" v-model="time" @confirm="confirm" show-buttons disabled></vue-datepicker-local> -->
    <vue-datepicker-local format="YYYY-MM-DD HH:mm:ss" v-model="time" @confirm="confirm" show-buttons></vue-datepicker-local>
  
  </div>
</template>

<script>
	import VueDatepickerLocal from 'vue-datepicker-local'
export default {
  name: 'HelloWorld',
  data () {
    return {
      msg: 'Welcome to Your Vue.js App',
       time: new Date()
    }
  },
  methods:{
  	confirm(e){
  		console.log(new Date(e))
  		let date = new Date(e);
  		console.log(date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() + ' '+ date.getHours() + ':'+ date.getMinutes() + ':' + date.getSeconds())
  	}
  }, 
  components:{
  	VueDatepickerLocal
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h1, h2 {
  font-weight: normal;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
